﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TeamNitro.Student
{
    public partial class Students_ChangePassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            

        }

        protected void btnPassChange_Click(object sender, EventArgs e)
        {
            
            DBManager_Jowie dbJowie = (DBManager_Jowie)Session["Student"];
            String id = dbJowie.AdminNumber;
            String oldPassword = tbxOldPassword.Text;
            String newPassword = tbxNewPassword.Text;
            bool result = DBManager_Jowie.ChangePassword(id, oldPassword, newPassword);
            if (result == true)
            {
                lblPassResult.Visible = true;
            }
        }

        
        

        protected void btnPassReset_Click(object sender, EventArgs e)
        {
            tbxConfirmPassword.Text = "";
            tbxNewPassword.Text = "";
            tbxOldPassword.Text = "";           
        }
    }
}